﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="eGoldWeekStocks.aspx.cs" Inherits="gold_eGoldWeekStocks" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="Javascript/jquery-1.4.4.min.js"></script>
    <link href="Canlendar/css/calendar.css"  rel="stylesheet" type="text/css" />
    <script  src="Canlendar/js/calendar.js" type="text/javascript"></script>
    <script type="text/javascript">
        function show_delete(id) {
            var lx = event.x
            var ly = event.y
            $('#hid_id').val(id);
            $('#Delete_View').css({ "display": "", "left": lx, "top": ly });
        }

        function show_modify(id,date,dailynews,dailyup,dailydown) {
            var lx = event.x
            var ly = event.y
            var news = String(dailynews);
            news = news.replace(/<br>/g, "\r\n");
            $('#hid_id').val(id);
            $('#date').val(date.substring(0, 9));
            $('#dailynews').val(news);
            $('#dailyup').val(dailyup);
            $('#dailydown').val(dailydown);
            $('#Modify_View').css({ "display": "", "left": 346, "top": ly });
            $('#date').attr("readonly", true);
            $('#date_tool').css("display", "none");  
        }

        $(document).ready(function () {
            //show add,modify view
            $('#show_add').click(function () {
                $('#hid_id').val('');
                $('#date').val('');
                $('#dailynews').val('');
                $('#dailyup').val('');
                $('#dailydown').val('');
                $('#date').attr("readonly", false);
                $('#date_tool').css("display", "");
                $('#Modify_View').css({ "display": "", "left": 346, "top": 70 });
            });
            //cancel it
            $('#modify_cancel').click(function () {
                $('#hid_id').val('');
                $('#Modify_View').css("display", "none");
            });

            //delete cancel
            $('#delete_cancel').click(function () {
                $('#hid_id').val('');
                $('#Delete_View').css("display", "none");
            });

        });

       
    </script>
    <style type="text/css">
        .style1
        {
            width: 88px;
        }
        .style2
        {
            width: 72px;
        }
        .style3
        {
            width: 281px;
        }
        .style4
        {
            width: 141px;
        }
        .style5
        {
            width: 176px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
      日期:<asp:TextBox ID="search_date" runat="server" Width="100px"></asp:TextBox> <IMG src="Canlendar/images/calendar.gif" align="absMiddle" border="0" onclick='javascript:popUpCalendarTR(document.getElementById("search_date"),document.getElementById("search_date"),"yyyy-mm-dd")'> 
        <asp:Button ID="search" runat="server" Text="查询" onclick="search_Click" /> 
      <input type=button id="show_add" value="新增" />     <input type=button id="Button1" value="转到编辑页" onclick="window.location.href='eGoldGetHtml.htm?type=ycww'" />
    
    </div>
    <div>
    
    <table border="0" align="left" cellpadding="3" cellspacing="0" 
            style="width: 77%;border: 1px solid #337ABB;" >
       <tr style=" background:#337ABB;">      
	     <td  align="left" class="style1">日期</td>
	     <td  align="left" class="style2">星期</td>
	     <td  align="left" class="style3">要闻</td>
	     <td  align="left" class="style4">涨</td>
         <td  align="left" class="style5">跌</td>
         <td  align="left">操作</td>
       </tr>
       <asp:Repeater ID="Repeater1" runat="server">
       <ItemTemplate>   
        <tr >
             <td valign=top><%#Eval("date", "{0:yyyy-MM-dd}")%></td> 
             <td valign=top><%#DataBinder.Eval(Container.DataItem, "dayofweek")%></td>
             <td valign=top><%#DataBinder.Eval(Container.DataItem, "dailynews")%></td>
             <td valign=top><%#DataBinder.Eval(Container.DataItem, "dailyup")%></td>
             <td valign=top><%#DataBinder.Eval(Container.DataItem, "dailydown")%></td>
             <td valign=top><a href="javascript:void(0)"  onclick="show_delete('<%#Eval("id")%>')">删除</a>
                 <a href="javascript:void(0)"  onclick="show_modify('<%#Eval("id")%>','<%#Eval("date")%>', '<%# Eval("dailynews") %>', '<%# Eval("dailyup") %>', '<%# Eval("dailydown") %>')">修改</a>
             </td>
        </tr>
        </ItemTemplate>
       </asp:Repeater>             
    </table>
    
    </div>

    <!--add,modify view-->
    <div id="Modify_View" style="display:none;position:absolute;z-index:99;left:346px; top:50px;border: 5px solid #337ABB; background-color:#FFFFFF;">
    <table>
    <tr><td>日期:</td><td><asp:TextBox ID="date" runat="server" Width="100px" ></asp:TextBox> <img src="Canlendar/images/calendar.gif" align="absMiddle" border="0" onclick='javascript:popUpCalendarTR(document.getElementById("date"),document.getElementById("date"),"yyyy-mm-dd")' id="date_tool" /></td></tr>
    <tr><td colspan=2> 一周证券要闻:</td></tr>
    <tr><td colspan=2><asp:TextBox ID="dailynews" runat="server" Height="94px" TextMode="MultiLine" 
            Width="414px"></asp:TextBox></td></tr>
    <tr><td>涨:</td><td><asp:TextBox ID="dailyup" runat="server" Width="389px"></asp:TextBox></td></tr>
    <tr><td>跌:</td><td><asp:TextBox ID="dailydown" runat="server" Width="387px"></asp:TextBox></td></tr>
    <tr><td  colspan=2>   
        <asp:Button ID="ADD" runat="server" Text="提交" onclick="ADD_Click" />&nbsp;<input type=button id="modify_cancel" value="取消" /></td></tr>
    </table>
    </div>


    <div id="Delete_View" style="display:none;position:absolute;z-index:99;left:346px; top:50px;border: 5px solid #337ABB; background-color:#FFFFFF;">
    <table><tr><td><asp:Button ID="DELETE" runat="server" Text="删除" onclick="Delete_Click" />&nbsp;<input type=button id="delete_cancel" value="取消" /></td></tr></table>
    </div>
    <input id="hid_id" type=hidden  value="" runat=server />  
    </form>
</body>
</html>
